/**
 * 
 */
package com.feonix.designPattern.prototype.sample1;

import com.feonix.designPattern.prototype.framework.Product;

/**
 * @CopyRight (c)1993-2017
 * @Project common_practice
 * @Comments 请输入该类的描述
 * @NameSpace com.feonix.designPattern.prototype.sample1
 * @Author Feonixzw
 * @CreateDate 2018年1月31日
 */
public class MessageBox implements Product {

	private char decochar;

	public MessageBox(char decochar) {
		this.decochar = decochar;
	}

	@Override
	public void use(String s) {
		int length = s.getBytes().length;
		for (int i = 0; i < length + 4; i++) {
			System.out.print(decochar);
		}
		System.out.println("");
		System.out.println(decochar + " " + s + " " + decochar);
		for (int i = 0; i < length + 4; i++) {
			System.out.print(decochar);
		}
		System.out.println("");

	}

	@Override
	public Product createClone() {
		Product p = null;
		try {
			p = (Product) clone();
		} catch (CloneNotSupportedException e) {
			e.printStackTrace();
		}
		return p;
	}

}
